package com.finance.system.support.rpc.netty;

import com.finance.system.support.rpc.netty.msg.PushMsg;
import io.netty.channel.socket.SocketChannel;

/**
 * Created with IDEA
 * 推送消息
 * @author: 董文辉
 * Date: 2018/1/3
 * Time: 11:06
 */
public class NettyPush {
    public static void push(PushMsg pushMsg){
        SocketChannel channel = (SocketChannel) NettyContextChannelMap.get(pushMsg.getPhoneNum());
        if (channel != null) {
            channel.writeAndFlush(pushMsg);
        }
    }
}
